using System.Windows.Controls;
using FluentSilverlight.Expressions;
using FluentSilverlight.MVVM;

namespace FluentSilverlight
{
    public abstract class OpinatedUserControlBase<TModel> 
        : UserControl, IOpinionatedControl<TModel> where TModel : class
    {
        public void SetModel(IViewModel model)
        {
            Model = (TModel) model;
        }

        public TModel GetModel()
        {
            return Model;
        }

        public TModel Model
        {
            get { return DataContext as TModel; }
            set { DataContext = value; }
        }

        public abstract void Initialize();
    }
}